<div class="box box-maxbid">
	<!-- form start -->
	 <div class="overlay" ng-show="hideform"></div>
    <div class="loading-img" ng-show="hideform"></div>
	
	<form role="form" name="UserForm">
		<div class="box-body">
			<div class="form-group row">
				<div class="col-md-7 col-xs-7">
					<label for="InputTipo">NOME</label> <input ng-model="user.NOME"
						name="NOME" class="form-control" />
					<div class="messages-alert"
						ng-show="userForm.NOME.$dirty && userForm.NOME.$invalid">
						<span ng-show="userForm.NOME.$error.required">* Campo requerido</span>
					</div>
				</div>
				<div class="col-md-5 col-xs-5">
					<label for="InputTipo">CARGO</label> <input
						ng-model="user.PROFISSAO" name="PROFISSAO" class="form-control" />
					<div class="messages-alert"
						ng-show="userForm.PROFISSAO.$dirty && userForm.PROFISSAO.$invalid">
						<span ng-show="userForm.PROFISSAO.$error.required">* Campo
							requerido</span>
					</div>
				</div>
			</div>
			<div class="form-group row">
				<div class="col-md-2 col-xs-3">
					<label for="InputTipo">CPF</label> <input ng-model="user.CPF_CNPJ"
						name="CPF_CNPJ" class="form-control" ui-mask="999.999.999-99"
						maxlength="15" />
					<div class="messages-alert"
						ng-show="userForm.CPF_CNPJ.$dirty && userForm.CPF_CNPJ.$invalid">
						<span ng-show="userForm.CPF_CNPJ.$error.required"> * Campo
							requerido</span>
					</div>
				</div>
				<div class="col-md-2 col-xs-3">
					<label for="InputTipo">RG</label> <input ng-model="user.RG_IE"
						name="RG_IE" class="form-control" ui-mask="99.999.999-9"
						maxlength="14" />

				</div>
				<div class="col-md-2 col-xs-3">
					<label for="InputTel">TELEFONE</label> <input
						ng-model="user.TELEFONE" name="TELEFONE" class="form-control"
						ui-mask="(99)9999-9999" />
				</div>
				<div class="col-md-2 col-xs-3">
					<label for="InputTel">TELEFONE 2</label> <input
						ng-model="user.TELEFONE_2" name="TELEFONE_2" class="form-control"
						ui-mask="(99)9999-9999" />
				</div>
				<div class="col-md-2 col-xs-3">
					<label for="InputTel">CELULAR</label> <input
						ng-model="user.CELULAR" name="CELULAR" class="form-control"
						ui-mask="(99)99999-9999" />
				</div>

			</div>
			<div class="form-group row">
				<div class="col-md-2 col-xs-4">
					<label for="InputTipo">ESTADO CIVIL</label> <select
						name="ESTADO_CIVIL" ng-model="user.ESTADO_CIVIL"
						ng-options="key.id as key.label for key in estadoCivilOptions"
						class="form-control">
						<option value="">Selecionar</option>
					</select>

					<div class="messages-alert"
						ng-show="userForm.ESTADO_CIVIL.$dirty && userForm.ESTADO_CIVIL.$invalid">
						<span ng-show="userForm.ESTADO_CIVIL.$error.required"> * Campo
							requerido</span>
					</div>
				</div>
				<div class="form-group">
					<div class="col-md-5 col-xs-5">
						<label for="InputTipo">EMAIL</label> <input type="email"
							ng-model="user.EMAIL" name="EMAIL" class="form-control" />
						<div class="messages-alert"
							ng-show="userForm.EMAIL.$dirty && userForm.EMAIL.$invalid">
							<span ng-show="userForm.EMAIL.$error.required"> * Campo requerido</span>
						</div>
					</div>
					<div class="col-md-5 col-xs-5">
						<label for="InputTipo">EMAIL ALTERNATIVO</label> <input
							type="email" ng-model="user.EMAIL_ALTERNATIVO"
							name="EMAIL_ALTERNATIVO" class="form-control" />
					</div>

				</div>
			</div>
			<hr />
			<div class="form-group row">
				<div class="col-md-2 col-xs-3">
					<label for="InputTipo">CEP</label> <input ng-model="user.CEP"
						name="CEP" class="form-control" ng-change="setLogradouro()"
						ui-mask="99999-999" />

				</div>
				<div class="col-md-5 col-xs-8">
					<label for="InputTipo">ENDEREÇO</label> <input
						ng-model="user.LOGRADOURO" name="LOGRADOURO"
						class="form-control disabled" maxlength="15" disabled="true" />
				</div>
				<div class="col-md-1 col-xs-2">
					<label for="InputTipo">NÚMERO</label> <input ng-model="user.NUMERO"
						name="NUMERO" class="form-control " maxlength="10" />
				</div>
				<div class="col-md-2 col-xs-3">
					<label for="InputTipo">COMPLEMENTO</label> <input
						ng-model="user.COMPLEMENTO" name="COMPLEMENTO"
						class="form-control " maxlength="20" />
				</div>

			</div>

			<div class="form-group row">
				<div class="col-md-3 col-xs-4">
					<label for="InputTipo">BAIRRO</label> <input ng-model="user.BAIRRO"
						name="BAIRRO" class="form-control" disabled="true" />

				</div>
				<div class="col-md-3 col-xs-4">
					<label for="InputTipo">CIDADE</label> <input ng-model="user.CIDADE"
						name="CIDADE" class="form-control" maxlength="20" disabled="true" />
				</div>
				<div class="col-md-1 col-xs-2">
					<label for="InputTipo">ESTADO</label> <input ng-model="user.UF"
						name="UF" class="form-control " maxlength="10" disabled="true" />
				</div>

			</div>
			<hr/>

			<div class="form-group row">

				<div class="col-md-3 col-xs-4">
					<label for="InputLogin">LOGIN</label> <input name="LOGIN"
						ng-model="user.LOGIN" class="form-control" placeholder="Login"
						ng-minlength="6" ng-maxlength="16" maxlength="16"
						ng-pattern="/^[a-zA-Z0-9\_]+$/" autocomplete="off">

					<div class="messages-alert"
						ng-show="UserForm.LOGIN.$dirty && UserForm.LOGIN.$invalid">
						<span ng-show="UserForm.LOGIN.$error.required">* Campo &eacute;
							obrigat&oacute;rio</span> <span
							ng-show="UserForm.LOGIN.$error.pattern"> * Caracter não permitido
						</span> <span ng-show="UserForm.LOGIN.$error.minlength"> * minimo
							de 6 caracteres </span> <span
							ng-show="UserForm.LOGIN.$error.maxlength"> * máximo de 16
							caracteres </span>
					</div>
				</div>
				<div class="col-md-3 col-xs-4">
					<label for="InputPwd">SENHA </label> <input type="password"
						name="PWD" class="form-control" ng-model="user.PWD"
						ng-minlength="6" ng-maxlength="16" ng-if="edit" />
						
						<input type="password" ng-if="add"
						 required
						name="PWD" class="form-control" ng-model="user.PWD"
						ng-minlength="6" ng-maxlength="16" />
					<div class="messages-alert"
						ng-show="UserForm.PWD.$dirty && UserForm.PWD.$invalid">
						<span ng-show="UserForm.PWD.$error.required">* Campo &eacute;
							obrigat&oacute;rio</span> <span
							ng-show="UserForm.PWD.$error.minlength">* O m&iacute;ximo de
							caracteres permitido &eacute; 6</span> <span
							ng-show="UserForm.PWD.$error.maxlength">* O m&aacute;ximo de
							caracteres permitido &eacute; 16</span>


					</div>
				</div>
				<div class="col-md-3 col-xs-4">
					<label for="InputConfirmPwd">CONFIRMAR SENHA </label> <input
						ng-if="add" type="password" name="confirmPwd" class="form-control"
						ng-model="user.confirmPwd" is-equals="[name=PWD]" required /> 
						<input
						ng-if="edit" type="password" name="confirmPwd"
						class="form-control" ng-model="user.confirmPwd"
						is-equals="[name=PWD]" />
					<div class="messages-alert"
						ng-show="UserForm.confirmPwd.$dirty && UserForm.confirmPwd.$invalid">
						<!-- <span ng-show="UserForm.confirmPwd.$error.required">* Campo &eacute; obrigat&oacute;rio<br/></span>
                       -->
						<span ng-show="UserForm.confirmPwd.$error.isequals">* A
							confirma&ccedil;&otilde;o de senha n&atilde;o &eacute; igual
							senha </span>

					</div>
				</div>

			</div>

			<div class="box-footer">
				<button type="submit" ng-disabled="UserForm.$invalid"
					ng-click="save()" class="btn btn-primary">Salvar</button>
					
					<button type="submit" ng-disabled="UserForm.$invalid"
					ng-click="save('true')" class="btn btn-primary">Salvar e Listar</button>
					

				<a href="#/users" class="btn btn-danger">Cancelar</a>
			</div>
	
	</form>
</div>
<!-- /.box -->
